package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Strategy;
import cn.wolfcode.trip.base.query.CollectQueryObject;
import cn.wolfcode.trip.base.query.SearchQueryObject;
import cn.wolfcode.trip.base.query.StrategyQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StrategyMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Strategy entity);

    Strategy selectByPrimaryKey(Long id);

    List<Strategy> selectAll();

    int updateByPrimaryKey(Strategy entity);

    List<Strategy> selectForList(StrategyQueryObject qo);

    /**
     * 通过关键字查询该攻略总数
     * @param keyword
     * @return
     */
    int selectCountByKeyword(String keyword);

    /**
     * 通过关键字查询攻略
     * @param qo
     * @return
     */
    List<Strategy> selectByKeyword(SearchQueryObject qo);

    /**
     * 查询用户收藏的攻略
     * @param qo
     * @return
     */
    List<Strategy> selectForCollect(CollectQueryObject qo);
}